package org.study.dynamic.ds.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 大屏模板类型
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2023年06月08日
 */
@Getter
@AllArgsConstructor
public enum ScreenModelEnum {
    BAOLIU(0, "SQL"),
    DITU(1, "地图"),
    ZHUZHUANGTU(2, "柱状图"),
    ZHEXIANTU(3, "折线图"),
    BINGTU(4, "饼图"),
    LIEBIAO(5, "列表"),
    SANDIANTU(6, "散点图"),
    DEFAULT(999, "未知类型");

    private Integer code;
    private String desc;

    public static ScreenModelEnum getValue(Integer code) {
        for (ScreenModelEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return ScreenModelEnum.DEFAULT;
    }
}
